module AdminMoviesHelper
  
  def show_img(option = {})
    if option[:img].nil?
      return image_tag("/images/little_pic_1", :class => :pic) if option[:thumbnail] == :thumb
      return image_tag("/images/little_pic_2", :class => :pic) if option[:thumbnail] == :cover
    else
      return image_tag(option[:img].public_filename(option[:thumbnail]), :class => :pic)
    end
  end
  
  def get_collection_link(movie)
    return link_to(" On Show ", on_show_path) if movie.show_status == 'on'
    return link_to(" Off Show ", off_show_path) if movie.show_status == 'off'
  end
  
  def get_cover(movie)
    cover = MoviePic.find_all_by_movie_id_and_cover(movie.id,'cover').size.zero? ? movie.movie_pics.first :  MoviePic.find_by_movie_id_and_cover(movie.id,'cover').nil?
  end
  
end
